//
//  DisDropBtn.m
//  小团购
//
//  Created by 樊荣海 on 15/1/23.
//  Copyright (c) 2015年 樊荣海. All rights reserved.
//

#import "DisDropBtn.h"

@implementation DisDropBtn

- (instancetype)initWithFrame:(CGRect)frame {
    
    if (self == [super initWithFrame:frame]) {
        
        self.imageView.contentMode = UIViewContentModeCenter;
        
        [self.titleLabel setTextAlignment:NSTextAlignmentCenter];

        [self.titleLabel setFont:[UIFont systemFontOfSize:14]];
        //
        //        [self addTarget:self action:@selector(locationClick) forControlEvents:UIControlEventTouchDown];
        
        // 1.右边的分割线
//        UIImage *img = [UIImage imageNamed:@"separator_filter_item.png"];
//        UIImageView *divider = [[UIImageView alloc] initWithImage:img];
//        divider.bounds = CGRectMake(0, 0, 0.5, DropScrollViewH * 0.7);
//        divider.center = CGPointMake(DropScrollViewW, DropScrollViewH * 0.5);
//        [self addSubview:divider];
        
        
    }
    
    return self;
    
}

- (NSArray *)titles {

    return _dis.neighborhoods;
}

- (void)setDis:(DistrictModel *)dis {
    
    _dis = dis;
    [self setTitle:_dis.name forState:UIControlStateNormal];
}

- (void)setName:(NSString *)name {
    [self setTitle:name forState:UIControlStateNormal];
}

//宽度写死
- (void)setFrame:(CGRect)frame {
    
    frame.size = CGSizeMake(DropScrollViewW, DropScrollViewH);
    [super setFrame:frame];
}

- (void)setBounds:(CGRect)bounds {
    
    bounds.size = CGSizeMake(DropScrollViewW, DropScrollViewH);
    [super setBounds:bounds];
}


@end
